package com.sxj.corejava.code08_常用类.String;

/**
 * @author 石小俊
 * @date 2024年04月13日 9:55
 */
public class Test12_可变字符串 {

    public static void main(String[] args) {
        StringBuffer buffer = new StringBuffer("Hello");
        StringBuilder builder = new StringBuilder("Hello");

        buffer.append("World");
        buffer.insert(0,"[");
        buffer.insert(11,"]");
        buffer.insert(6,",");
        buffer.delete(6,12);
        buffer.deleteCharAt(0);
        buffer.deleteCharAt(5);
        buffer.append(" World");
        buffer.setLength(5);
        buffer.setLength(5);
        buffer.setLength(10);

        System.out.println(buffer);
//        System.out.println(builder);

        String s = buffer.toString();
    }

}
